import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/login', component: () => import('../views/login.vue'), name: 'login' },
    {
      path: '/home',
      component: () => import('../views/layout.vue'),
      name: 'home',
      redirect: '/home/list',
      children: [
        { path: '/home/list', component: () => import('../views/list.vue'), name: 'list' },
        { path: '/home/reg', component: () => import('../views/reg.vue'), name: 'reg' }
      ]
    }
  ],
  history: createWebHashHistory()
})

export default router
